/*
2021-7-15 
https://www.acwing.com/problem/content/1051/
*/
#include<iostream>

using namespace std;
const int N=1e5+10;
int a[N],f[N][2];

int main()
{
    int T;
    cin>>T;
    while(T--)
    {
        int n;
        cin>>n;
        for(int i=1;i<=n;i++)
        {
            cin>>a[i];
        }
        
        f[0][0]=0,f[0][1]=-1e9;
        for(int i=1;i<=n;i++)
        {
            f[i][0]=max(f[i-1][0],f[i-1][1]);
            f[i][1]=f[i-1][0]+a[i];
        }
        
        cout<<max(f[n][0],f[n][1])<<endl;
        
    }
    return 0;
}
